var EP=require('eventproxy');
var mock=require('./mock.js');

function getContent(cb){
    var ep=new EP();
    ep.all('get','read',(get,read)=>{
        cb(null,{get:get,read:read});
    });

    ep.fail(cb);

    mock.get(0,ep.done('get'));
    mock.read(1,ep.done('read'));
}


getContent((err,data)=>{
    if(err)return console.log('getContent err:',err);
    console.log('getContent data:',data);
})